package sr.codemg.entity;

import lombok.Data;
import org.springframework.util.StringUtils;

/**
 * 菜单信息
 **/
@Data
public class SysMenus implements Comparable<SysMenus>, java.io.Serializable {
    private String id;
    private String title;
    private String key;
    private String icon;
    private String superId;
    private String btnId;
    private String menuOrder;

    @Override
    public int compareTo(SysMenus o) {
        if (StringUtils.isEmpty(this.getMenuOrder())) {
            return 1;
        }
        if (StringUtils.isEmpty(o.getMenuOrder())) {
            return -1;
        }
        if (Integer.parseInt(menuOrder) > Integer.parseInt(o.getMenuOrder())) {
            return 1;
        } else if (Integer.parseInt(menuOrder) == Integer.parseInt(o.getMenuOrder())) {
            return 0;
        } else {
            return -1;
        }
    }
}
